#ifndef DATAGRABBER_H
#define DATAGRABBER_H

#include <QTimer>
#include <stdio.h>
#include <QString>
#include <QDebug>
#include <QFile>
#include "delib.h"
#include "conio.h"
#include "Control/config.h"


// size of the ringbuffer
const int ringBufferSize = 50;

class DataGrabber : public QTimer
{
    Q_OBJECT
public:
    DataGrabber(ulong boxHandle);

    void grabVolt();

    ulong handle;

   // QTimer drawTimer;
   // QTimer logTImer;

private:

    double averageRingBuffer[SENSOR_COUNT][ringBufferSize];


    void saveAverageSamples(int ordinal, double value);
    int ringBufferPtr[ringBufferSize];
    double getSampleAverage(int ordinal);



public slots:
    void shot();

signals:

    void newValue(int,double);
    void grabFinished();
};

#endif // BIMOSBOXTIMEHANDLER_H
